// dialog script for town 12: Fort Filbert.

begintalkscript;

variables;

int m,n;

// *** soldiers and guards ***

begintalknode 1;
	state = -1;
	personality = 42;
	nextstate = -1;
	condition = 1;
	question = "Guard";
	text1 = "A big man is busy working here. As soon as you want to ask him something, he turns to you and says he doesn't have time. You go away.";
	text2 = "The guard looks at you. After having pondered about something (probably Commander Johnson), he politely says he doesn't have time, and asks you to go away. You do so.";
	action = END_TALK;
	code =
		if (get_flag(12,11) == 0)
				remove_string(2);
				
		if (get_flag(12,11) == 1)
				remove_string(1);
	break;

begintalknode 2;
	state = -1;
	personality = 43;
	nextstate = -1;
	condition = 1;
	question = "Soldier";
	text1 = "This is a typical Riverrod soldier. His armor shines. It was probably just polished. He seems too busy to talk to you though. You turn away and leave the soldier to his business.";
	text2 = "You try to ask this soldier a question. However, he doesn't seem to have time for you. He looks you over, recognises as the ones who caught Commander Johnson, and immediately wants you to answer all his questions. You do so, and then leave.";
	action = END_TALK;
	code =
		if (get_flag(12,11) == 0)
				remove_string(2);	
		if (get_flag(12,11) == 1)
				remove_string(1);
	break;
	
// *** Commander Johnson ***

begintalknode 3;
	state = -1;
	personality = 39;
	nextstate = 1;
	condition = 1;
	question = "Commander Johnson";
	text1 = "Commander Johnson is a heavy built man with big, shiny armor. He looks at you with a smile. _I'm glad to see you are feeling better._";
	text2 = "Commander Johnson is waiting for you to speak up. He is still smiling at you. you wonder what makes him happy. The province isn't in such a good state, and he probably is very busy. Why would he smile, then?";
	code =
		if (get_flag(12,6) != 2)
				remove_string(2);

		if (get_flag(12,6) == 2)
				remove_string(1);
	
		set_flag(12,6,2);
	break;

begintalknode 4;
	state = 1;
	personality = 39;
	nextstate = 2;
	condition = 1;
	question = "Could you tell us what attacked that village?";
	text1 = "_Ah, yes. I already thought you would want to know that. They are a cat sort of beast, bigger and more vicious than the Nephilim and Nepharim. They call themselves _Senarti._ I don't know where they came from and why they attack us._";
	text2 = "_I think you should go to Pleasantville for more information about them. There lives a wizard in Pleasantville. I forgot his name, but you'll find him._ Upon saying this, he smiles and offers you some chocolate. You wonder how he got it.";

begintalknode 5;
	state = 2;
	personality = 39;
	nextstate = 3;
	condition = 1;
	question = "Where is the attacked village?";
	text1 = "_You want to go back?_ He looks at you with amazement. _Maybe, if you're going there, you could do something for me?_ He looks hopefully at you. _By the way, the village is called Stracton._";
	text3 = "_So you didn't find it yet? Okay. You go out of the fort, down the passage, and turn right. Then when you leave this cavern, you go right and follow the road. That's all._";
	text5 = "_Well, you did your job, but if you really want to go back, go south of here._";
	code =
		if (get_flag(12,0) == 0) {
				remove_string(3);
				remove_string(5);
				}
		if (get_flag(12,0) == 1) {
				remove_string(1);
				remove_string(5);
				}
		if (get_flag(12,0) == 2) {
				remove_string(1);
				remove_string(3);
				}
	break;

begintalknode 6;
	state = 3;
	personality = 39;
	nextstate = 4;
	condition = get_flag(12,0) == 0;
	question = "Of course, what is it you want us to do?";
	text1 = "_I'd like you to search for clues. Maybe you can find out something about them?_";

begintalknode 7;
	state = 4;
	personality = 39;
	nextstate = 1;
	condition = 1;
	question = "We'll try to find something, but we can't promise we'll find something.";
	text1 = "_Thanks very much._ He looks happy. The village is just south of us. Actually, its not far from the Riverrod border._ He points to the south.";
	code =
		toggle_quest(7,1);
		set_flag(12,0,1);
		set_flag(15,0,1);
	break;

begintalknode 8;
	state = 3;
	personality = 39;
	nextstate = 1;
	condition = get_flag(12,0) == 0;
	question = "No, we want to travel in Riverrod.";
	text1 = "_I can understand that. The village is just south of here. Follow the road to the east of this fort. Then go south._";

begintalknode 9;
	state = 4;
	personality = 39;
	nextstate = 1;
	condition = 1;
	question = "No, that we don't want to do. It seems outright boring, sorry.";
	text1 = "_Well, okay._  He looks disappointed. _The village is to the south of here, although I don't see a point in going there._ His smile has faded, but it quickly returns.";

begintalknode 10;
	state = 1;
	personality = 39;
	nextstate = -1;
	condition = get_flag(12,0) == 1 && get_flag(15,1) == 1;
	question = "We found something. Its a piece of paper.";
	text1 = "_A piece of paper?_ You show it to him. _Interesting. It says something about creation vats. Take it to the wizard in Pleasantville. He'll know what to do with it._ He hands you the paper.";
	code =
		award_party_xp(20,4);
		set_flag(12,0,2);
		set_flag(12,5,1);
		toggle_quest(7,0);
	break;

begintalknode 11;
	state = 1;
	personality = 39;
	nextstate = 5;
	condition = 1;
	question = "Where do you think its best for us to go?";
	text1 = "He folds his legs over one another, and starts thinking. _I think you could best go to Pleasantville or to Voughton, which the capital of Riverrod._";
	
begintalknode 12;
	state = 5;
	personality = 39;
	nextstate = 1;
	condition = 1;
	question = "Where is Pleasantville?";
	text1 = "_Follow the roads. There will be signs._";

begintalknode 13;
	state = 5;
	personality = 39;
	nextstate = 1;
	condition = 1;
	question = "Where is Voughton?";
	text1 = "_The capital is north of here. Just follow the roads, and you will get there soon enough._ He takes a bite of his chocolate bar, and then adds to that: _Voughton is an enormous walled city with a river running through it. It's hard to miss._";
	
// *** Lieutenant Furginson ***

begintalknode 14;
	state = -1;
	personality = 41;
	nextstate = 6;
	condition = 1;
	question = "Lieutenant Furginson";
	text1 = "In this beautiful room, sits a young lady on her chair at a desk. She wears a priestesses robe. She smiles at you when see sees you. _Come in,_ she says.";

begintalknode 15;
	state = 6;
	personality = 41;
	nextstate = 7;
	condition = 1;
	question = "What is your function in this fort?";
	text1 = "_I do several things. I plan missions with the Commander, I heal people and I'm the guardian of our temple._";

begintalknode 16;
	state = 7;
	personality = 41;
	nextstate = 8;
	condition = 1;
	question = "Could you tell us anything about the missions?";
	text1 = "_I don't know if I should tell you anything about that._ You look at her with a hopeful smile.";
	text2 = "_Well alright then. If you talked with the Commander already, you know what's going on. There have been raids by those big cats. Or the _Senarti,_ as they call themselves. I basically try to figure out their strategies._";

begintalknode 17;
	state = 8;
	personality = 41;
	nextstate = 6;
	condition = 1;
	question = "Did you it figure out already?";
	text1 = "Her smile fades away slowly. She seems disappointed. _No, not yet. But I'm still working on it. They are terribly smart, you know. I hope we can stop them._";
	text2 = "She shrugs. _Well, there's no real need for it anymore, is there._ She is very glad she can say that, you can see that.";
	code =
		if (get_flag(5,1) != 2) {
				remove_string(2);
				}
		
		if (get_flag(5,1) == 2) {
				remove_string(1);
				}
	break;

begintalknode 18;
	state = 8;
	personality = 41;
	nextstate = 7;
	condition = 1;
	question = "Maybe you can tell us more about the raids?";
	text1 = "_Well you've been at one yourself. That's the one where you've been beaten into unconsciousness. It's good that we could save you, otherwise God knows what would have happened to you._";
	text2 = "She thinks. _We have seen though, that they are particularly interested in things that are worth a lot. For example, Flanagan, a wizard in Pleasantville, his spell book got stolen. The Senarti have it. I suggest you go to him to ask about it._";

begintalknode 19;
	state = 7;
	personality = 41;
	nextstate = 7;
	condition = 1;
	question = "Can you heal us?";
	text1 = "_I'm sorry, but my powers are limited at the moment. I could spare my energy to heal you when you got in, but the rest of my energy should be saved for other soldiers. I'm sorry.";

begintalknode 20;
	state = 7;
	personality = 41;
	nextstate = 9;
	condition = 1;
	question = "What can you tell us about the temple?";
	text1 = "She looks at you happily. She is pleased that somebody takes interest at all. _That temple is rather old. I'm the second guardian of this holy place. I hope that I can bring forward a good successor. I don't think I will find one, though._ She sighs.";

begintalknode 21;
	state = 9;
	personality = 41;
	nextstate = 10;
	condition = 1;
	question = "Why do you say that?";
	text1 = "_Its a difficult thing to do. Many children go away, to other places less dangerous. Many fear the Empire, but many more fear a coming revenge of Emperor Thralni. If you want to know more about him, go to Voughton._ She nods.";

begintalknode 22;
	state = 10;
	personality = 41;
	nextstate = -1;
	condition = 1;
	question = "What do you think would happen?";
	text1 = "She looks at her desk. She opens one of the drawers and pulls out a letter. _I got this not long ago. Its sender isn't mentioned, but I suspect it was probably the Empire Liaison of Riverrod._";
	text2 = "You spend some time looking at the letter. It doesn't say much, but it does give orders to ignore everything _that stupid Thralni_ may say. You give it back to her. She puts it back in her drawer.";
	text3 = "Without her saying much, you can still understand what she is aiming at. War. She nods at you, and asks, with a pleasant smile: _Is there something else I can help you with?_";

// *** Wizard sleeping at table ***

begintalknode 23;
	state = -1;
	personality = 45;
	nextstate = -1;
	condition = 1;
	question = "Wizard";
	text1 = "In this chair there's a wizard sitting. He snores. You decide not to wake him up. You go away.";
	action = END_TALK;

// *** Sergeant peter ***

begintalknode 24;
	state = -1;
	personality = 41;
	nextstate = 11;
	condition = 1;
	question = "Sergeant Peter";
	text1 = "A big proud man with a beautiful helmet enjoys his soup. You walk over to him and sit down. He looks at you with suspicion. _Can I help you?_";

begintalknode 25;
	state = 11;
	personality = 41;
	nextstate = -1;
	condition = 1;
	question = "What are you doing?";
	text1 = "_Can't you see? I'm eating. Now go away._ What a rude man. You stand up and leave.";
	action = END_TALK;

// *** Kellin ***

begintalknode 26;
	state = -1;
	personality = 40;
	nextstate = 12;
	condition = 1;
	question = "Kellin";
	text1 = "A black women is busy in the fort's kitchen. She's cutting vegetables. Probably for the soup that's standing on the fire. It smells awful.";
	text3 = "You come into the kitchen. Immediately Kellin spots you. She still seems to be angry about what you said. _You! Get out of my kitchen!_ You quickly leave her alone with her awful tasting stew.";
	code =
		if (get_flag(12,4) == 0)
				remove_string(3);
		if (get_flag(12,4) == 1) {
				remove_string(1);
				end();
				}
	break;

begintalknode 27;
	state = 12;
	personality = 40;
	nextstate = 13;
	condition = 1;
	question = "What are you cooking? It smells... quite... lovely.";
	text1 = "_I'm making a doughnut stew. Sounds good, Don't you think?_ You give her a smile to be polite. _Oh well. A name isn't the important thing about food, is it? Its the taste. Want to try some? Its good.";

begintalknode 28;
	state = 13;
	personality = 40;
	nextstate = 14;
	condition = 1;
	question = "Yes, why not.";
	text1 = "She puts a bit on a spoon and gives it to you. You take a small bite. You chew, chew and chew. You don't want to let her know that its really awful. She looks at you and asks: _How is it?_";

begintalknode 29;
	state = 13;
	personality = 40;
	nextstate = -1;
	condition = 1;
	question = "No, thanks, I already ate something.";
	text1 = "_What a pity._ She puts the spoon away she already had taken out of the drawer, especially for you. _Was there something else I could help you with?_";

begintalknode 30;
	state = 14;
	personality = 40;
	nextstate = -1;
	condition = get_flag(12,18) == 0;
	question = "Its, Um... nice...";
	text1 = "Her face, cramped of nerves, loosens. She seems very relieved by this. _Thanks! Now, what did you want to ask me?_";
	code =
		set_flag(12,18,1);
	break;	

begintalknode 31;
	state = 14;
	personality = 40;
	nextstate = -1;
	condition = get_flag(12,18) == 0;
	question = "Its really awful!";
	text1 = "Her face, cramped of nerves, looks very angry now. _How dare you say that! She throws the bit she had on the spoon in her hand at you. Now get out!_";
	action = END_TALK;
	code =
		set_flag(12,18,1);
		set_flag(12,4,1);
	break;

begintalknode 32;
	state = 12;
	personality = 40;
	nextstate = 15;
	condition = 1;
	question = "How are you doing?";
	text1 = "She smiles. _I'm fine, thanks. Working hard to supply this place with food. It would have been easier without the Senarti. Because of raids, most merchants are scared to come here and supply me with fresh food._ She points at the somewhat empty shelves.";

begintalknode 33;
	state = 15;
	personality = 40;
	nextstate = -1;
	condition = 1;
	question = "Do these merchants travel from far?";
	text1 = "_I don't know. I think so, yes._ she looks at the floor when saying this. She seems quite interested in that small piece of dust that's hanging around over there.";
	text2 = "_I'll be right back._ She walks away and comes back with a towel. She starts cleaning the floor. When she's finished, she brings the towel back and comes back to talk to you. _Any other things you wanted to know?_";

begintalknode 34;
	state = 15;
	personality = 40;
	nextstate = -1;
	condition = 1;
	question = "Do you run out of food quickly?";
	text1 = "She thinks. _It depends. Sometimes, when many of our men are out hunting the Senarti, I run out of food less quickly. When they come back, I usually also don't run out of food quite soon, because many men were killed._";
	text2 = "You look frightened at her while she says that. She laughs. _Don't worry, only if you come really close to their home they will kill you. Its that big hill to the west of here._";
	
// *** General Flamington ***

begintalknode 35;
	state = -1;
	personality = 47;
	nextstate = 16;
	condition = 1;
	question = "General Flamington";
	text1 = "A heavily armored dervish sits at this desk. He writes. When you come in, he puts his pen and paper away and turns to you. He smiles. _Hello, how are you! You were heavily wounded. Glad to see you standing again. What can I do for you?_";
	code = 
		set_flag(12,7,2);
	break;

begintalknode 36;
	state = 16;
	personality = 47;
	nextstate = 17;
	condition = 1;
	question = "What are your duties?";
	text1 = "_I mainly travel between towns of the Empire, and see what needs to be done. Now, for example, I'm writing a letter back to the Empire Central headquarters, to inform them of the Senarti problem._";

begintalknode 37;
	state = 17;
	personality = 47;
	nextstate = 16;
	condition = 1;
	question = "What can you tell us about the Senarti?";
	text1 = "His smile begins to fade. _Evil. Bad. Vicious. Ransacking all small villages and farms. It's depressing. They are really strong. I suggest you go talk to Commander Johnson. He knows more about this._";

begintalknode 38;
	state = 17;
	personality = 47;
	nextstate = 16;
	condition = 1;
	question = "So you were in many towns then?";
	text1 = "_Oh yes. I remember in particular my time in Valorim. It was awful. All these plagues. All this disaster._ A tear drops on his heavily brushed armor. _I'd rather not talk about it now._";

begintalknode 39;
	state = 16;
	personality = 47;
	nextstate = 16;
	condition = get_flag(8,9) == 1;
	question = "We found this riddle. Can you help us with it? (Tell him the riddle)";
	text1 = "_Hmmm. This is a difficult one. The only thing I know of crystals in Riverrod is the crystal mines in Northern Riverrod. I suggest starting your search there. I don't understand the rest of the riddle, though._";
	text2 = "_Anyway, to make it easier for you, here is an Empire order. It will enable you to enter the mines at will._ You thank him for this. As you leave the room, you look at him once more. He looks back at you, but promptly start working again.";
	text3 = "You tell him the riddle about the crystals. _You already told me that one, didn't you? I also gave you my help. Now please, don't waste any more of my time, okay?_";
	code =
		if (get_flag(12,19) == 1) {
				remove_string(1);
				remove_string(2);
				}

		if (get_flag(12,3) == 0) {
				set_flag(12,3,1);
				set_flag(12,19,1);
				change_spec_item(13,1);
				remove_string(3);
				}
	break;

begintalknode 40;
	state = 16;
	personality = 47;
	nextstate = 16;
	condition = 1;
	question = "How could you assist us?";
	text1 = "_In the past, I always was good with riddles and puzzles. If you want a puzzle solved, I may be able to offer a helping hand. Otherwise, I could use my influence._ He grins when saying this and points at several Empire orders.";